Skip to content

Allow clients to configure the global workspace search limit #10802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2022

Conversation

knutwalker
Copy link
Contributor

Playing around with helix I realized that the global worksapce symbol search works different compared to vs-code.
Helix requires all possible symbols in one query and does no subsequent refinement searched.
This PR adds a configuration option to override the default search limit with the default being the currently hardocded value.
Helix users can increment this limit for their instance with a config like

[[language]]
name = "rust"
language-server = { command = "rust-analyzer" }
[language.config]
workspace = { symbol = { search = { limit = 65536 }}}

Other editors are not affected by this change.

@knutwalker
Copy link
Contributor Author

I'm not sure how or if this should be tested. I can add a test with some pointers on where to start :)

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm though I wonder if we should prevent the user from being able to set the limit to 0 somehow as such a limit would render the feature useless(not that I expect anyone to set it to 0)

@Veykril
Copy link
Member

Veykril commented Apr 3, 2022

bors r+

regarding my review above we can address that with #11790

@bors
Copy link
Contributor

bors bot commented Apr 3, 2022

@bors bors bot merged commit bc0825d into rust-lang:master Apr 3, 2022
@lnicola
Copy link
Member

lnicola commented Apr 4, 2022

Wouldn't 0 generally mean "no limit"?

@Veykril
Copy link
Member

Veykril commented Apr 4, 2022

I guess? Not sure what our implementation does right now there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants